#include <stdio.h>
#include <math.h>
#include <gl/glut.h>
#include "model.h"

void Line::draw()
{
	printf("Line\n");
}

int Line::isInside(int x, int y)
{
	return 0;
}

double Line::distance(int x, int y)
{
	return 0;
}

void Rect::draw()
{
	printf("Rect\n");
}

int Rect::isInside(int x, int y)
{
	return 0;
}

double Rect::distance(int x, int y)
{
	return 0;
}

void Triangle::draw()
{
	printf("Triangle\n");
}

int Triangle::isInside(int x, int y)
{
	return 0;
}

double Triangle::distance(int x, int y)
{
	return 0;
}

void Circle::draw()
{
	printf("Circle\n");
}

int Circle::isInside(int x, int y)
{
	printf("radius=%d\n", radius);
	printf("x=%d  y=%d\n", x, y);
	return (x - point_x1) * (x - point_x1) + (y - point_y1) * (y - point_y1) - radius * radius < 0;
}

double Circle::distance(int x, int y)
{
	return abs(sqrt(double((x - point_x1) * (x - point_x1) + (y - point_y1) * (y - point_y1))) - radius);
}
